<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!-- 使用 jsp:useBean,如同 request.getAttribute( "loginBean" ); -->
<jsp:useBean id="loginBean" scope="request" class="common.LoginBean"/>

<!-- 因為已使用了 jsp:useBean, 所以可以直接使用 loginBean.getAccount() -->
<%
  System.out.println( "account in the jsp:" + loginBean.getAccount() );
  System.out.println( "password in the jsp:" + loginBean.getPassword() );    
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body> 
  <!-- jsp:getProperty, 如同 loginBean.getAccount() -->
  laccount:<jsp:getProperty name="loginBean" property="account"/><br>
  password:<jsp:getProperty name="loginBean" property="password"/>
</body>
</html>